Date: Wed, 25 Sep 1996 19:42:33 -0500 (CDT) From: (Peter da Silva) Here's a local-only UDP bot that can be used as a sample spam-blocker. I use it rather than ME because it can be fed a subset of the feed, and covers remotely injected spam. #!/usr/local/bin/tcl -f # # Use with # # udp\ # :groups,to,protect\ # :Tp:/usr/local/news/gateways/udp.bot < %s # # in your INN 'newsfeeds' file. Some translation necessary for C News. # proc remove {id reason} { if [catch {exec ctlinnd cancel $id} result] { if {"$result" != "Ok"} { set ofp [open "|/usr/sbin/sendmail udp-bot" w] puts $ofp "Subject: error from udp-bot" puts $ofp "" puts $ofp "Attempting to remove <$id> because:" puts $ofp "" puts $ofp "$reason" puts $ofp "" puts $ofp "Stack trace:" puts $ofp "" puts $ofp "$result" close $ofp } } exit 0 } proc udpcheck {messageid name} { regexp {(.*) \(.*\)} $name junk name regexp {.*<(.*)>} $name junk name switch -- [string tolower $name] { *@*cyberpromo.com { remove $messageid "CyberPromo is under UDP" exit 0 } } } set headerline bogus-headers while {[gets stdin header] > 0} { if { [regexp -- "^\(\[^ \t:\]*\): *\(.*\)$" $header x headerline body] || [regexp -- "^ *\(.*\)$" $header x body] || [regexp -- "^\t\(.*\)$" $header x body] } { append headers([string tolower $headerline]) $body } append header_text "$header\n" } regsub "<\(.*\)>" $headers(message-id) {\1} messageid udpcheck $messageid $headers(message-id) udpcheck $messageid $headers(from) udpcheck $messageid $headers(reply-to) exit 0